package com.yihubang.taobaokotlin.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import butterknife.ButterKnife
import butterknife.Unbinder

/*
 * class title: 
 * Author by RenChunLin, Email 18957806320@163.com, Date on 2021/3/3.
 * PS: Not easy to write code, please indicate.
 */
abstract class BaseActivity : AppCompatActivity() {

    private lateinit var bind: Unbinder

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(getLayoutResId())
        bind = ButterKnife.bind(this)
        initView()
        initEvent()
        initPresenter()
    }

    abstract fun getLayoutResId(): Int
    abstract fun initView()
    open fun initEvent() {

    }

    open fun initPresenter() {

    }

    override fun onDestroy() {
        super.onDestroy()
        release()
    }

    open fun release() {

    }
}